/**
 * File Info：com.mys.springboot.config.orm.JpaConfiguration.java
 * Created Date：2017年5月2日 下午1:51:04
 * Created User: mys
 */
package com.mys.springboot.config.orm;

import javax.annotation.Resource;
import javax.sql.DataSource;

import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Configuration
@EnableTransactionManagement
@EntityScan(basePackages = "com.mys.springboot.model")
@EnableJpaRepositories(basePackages = "com.mys.springboot.repostory")
public class JpaConfiguration {
	@Resource
	private DataSource dataSource;

	@Bean
	public JdbcTemplate jdbcTemplate() {
		return new JdbcTemplate(dataSource);
	}

}
